package com.sgcc.statistics.service.impl;

import java.beans.ConstructorProperties;
import java.util.Date;
import java.util.List;
import com.sgcc.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sgcc.statistics.mapper.OConsPercentageMapper;
import com.sgcc.statistics.domain.OConsPercentage;
import com.sgcc.statistics.service.IOConsPercentageService;

/**
 * OConsPercentageService业务层处理
 * 
 * @author sgcc
 * @date 2021-04-15
 */
@Service
public class OConsPercentageServiceImpl implements IOConsPercentageService 
{
    @Autowired
    private OConsPercentageMapper oConsPercentageMapper;

    /**
     * 查询OConsPercentage
     * 
     * @param id OConsPercentageID
     * @return OConsPercentage
     */
    @Override
    public OConsPercentage selectOConsPercentageById(String id)
    {
        return oConsPercentageMapper.selectOConsPercentageById(id);
    }

    /**
     * 查询OConsPercentage列表
     * 
     * @param oConsPercentage OConsPercentage
     * @return OConsPercentage
     */
    @Override
    public List<OConsPercentage> selectOConsPercentageList(OConsPercentage oConsPercentage)
    {
        return oConsPercentageMapper.selectOConsPercentageList(oConsPercentage);
    }

    /**
     * 新增OConsPercentage
     * 
     * @param oConsPercentage OConsPercentage
     * @return 结果
     */
    @Override
    public int insertOConsPercentage(OConsPercentage oConsPercentage)
    {
        oConsPercentage.setCreateTime(DateUtils.getNowDate());
        return oConsPercentageMapper.insertOConsPercentage(oConsPercentage);
    }

    /**
     * 修改OConsPercentage
     * 
     * @param oConsPercentage OConsPercentage
     * @return 结果
     */
    @Override
    public int updateOConsPercentage(OConsPercentage oConsPercentage)
    {
        oConsPercentage.setUpdateTime(DateUtils.getNowDate());
        return oConsPercentageMapper.updateOConsPercentage(oConsPercentage);
    }

    /**
     * 批量删除OConsPercentage
     * 
     * @param ids 需要删除的OConsPercentageID
     * @return 结果
     */
    @Override
    public int deleteOConsPercentageByIds(String[] ids)
    {
        return oConsPercentageMapper.deleteOConsPercentageByIds(ids);
    }

    /**
     * 删除OConsPercentage信息
     * 
     * @param id OConsPercentageID
     * @return 结果
     */
    @Override
    public int deleteOConsPercentageById(String id)
    {
        return oConsPercentageMapper.deleteOConsPercentageById(id);
    }

    @Override
    public OConsPercentage selectOConsPercentageByunitAndTime(String deptId,String startTime, String endTime) {
        return oConsPercentageMapper.selectOConsPercentageByunitAndTime(deptId,startTime,endTime);
    }

    @Override
    public List<OConsPercentage> selectOConsPercentageByunitAndTimeList(List<String> orgNoList, String sTime, String eTime) {
        return oConsPercentageMapper.selectOConsPercentageByunitAndTimeList(orgNoList,sTime,eTime);
    }

    /*public static void main(String[] args) {
        Date endDate = DateUtils.getEndDayOfLastMonth();
        String endTime = DateUtils.longSdf.format(endDate);
        // 获取开始时间
        String startTime = endTime.substring(0,10) + " 00:00:00";

        System.out.println(endTime+ "-----------" +startTime);
    }*/
}
